<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
	<namespaces>
		<Namespace>
			<prefix>gml</prefix>
			<uri>http://www.opengis.net/gml</uri>
		</Namespace>
		<Namespace>
			<prefix>gsml</prefix>
			<uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
		</Namespace>
        <Namespace>
            <prefix>xlink</prefix>
            <uri>http://www.w3.org/1999/xlink</uri>
        </Namespace>
	</namespaces>
	<sourceDataStores>
		<DataStore>
			<id>MappedFeaturePropertyfile</id>
			<parameters>
				<Parameter>
					<name>directory</name>
					<!-- path can be relative to this file if starts with "file: -->
					<value>file:./</value>
				</Parameter>
			</parameters>
		</DataStore>
	</sourceDataStores>
	<targetTypes>
		<FeatureType>
			<schemaUri>http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd</schemaUri>
		</FeatureType>
	</targetTypes>
	<typeMappings>
		<FeatureTypeMapping>
			<sourceDataStore>MappedFeaturePropertyfile</sourceDataStore>
			<sourceType>MappedFeaturePropertyfile</sourceType>
			<targetElement>
				gsml:MappedFeature
			</targetElement>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>
						gsml:MappedFeature
					</targetAttribute>
                    <idExpression>
                        <OCQL>'string constant'</OCQL>
                    </idExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:name</targetAttribute>
					<sourceExpression>
						<OCQL>LEX_D</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:shape</targetAttribute>
					<sourceExpression>
						<OCQL>SHAPE</OCQL>
					</sourceExpression>
				</AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>gsml:samplingFrame</targetAttribute>
                    <ClientProperty>
                        <name>xlink:href</name>
                        <value>'urn:cgi:feature:CGI:EarthNaturalSurface'</value>
                    </ClientProperty>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>gsml:specification</targetAttribute>
                    <sourceExpression>
                        <OCQL>GEOLOGIC_UNIT_ID</OCQL>
                        <linkElement>geologicUnitNoId</linkElement>
                        <linkField>FEATURE_LINK</linkField>
                    </sourceExpression>                    
                </AttributeMapping>
			</attributeMappings>
		</FeatureTypeMapping>
		<FeatureTypeMapping>		
			<mappingName>geologicUnitNoId</mappingName>
			<sourceDataStore>MappedFeaturePropertyfile</sourceDataStore>
			<sourceType>GeologicUnit</sourceType>
			<targetElement>gsml:GeologicUnit</targetElement>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>gsml:GeologicUnit</targetAttribute>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:description</targetAttribute>
					<sourceExpression>
						<OCQL>TEXTDESCRIPTION</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
			            gml:name[1]
  		            </targetAttribute>
					<sourceExpression>
						<OCQL>NAME</OCQL>
					</sourceExpression>					
					<isMultiple>true</isMultiple>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'urn:ietf:rfc:2141'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
		                gml:name[2]
		            </targetAttribute>
					<sourceExpression>
						<OCQL>ABBREVIATION</OCQL>
					</sourceExpression>					
		            <isMultiple>true</isMultiple>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
		                FEATURE_LINK
		            </targetAttribute>
					<sourceExpression>
						<OCQL>GML_ID</OCQL>
					</sourceExpression>
				</AttributeMapping>
	        </attributeMappings>
	    </FeatureTypeMapping>
	</typeMappings>
</as:AppSchemaDataAccess>